<div class="modal" ng-controller="KisBpmAssignmentPopupCtrl" xmlns="http://www.w3.org/1999/html">
    <div class="modal-dialog modal-wide">
        <div class="modal-content">
            <div class="modal-header">
                <button class="close" data-dismiss="modal" ng-click="close()">&times;
                </button>
                <h2 translate>PROPERTY.ASSIGNMENT.TITLE</h2>
            </div>

            <div class="modal-body">
                <div class="row row-no-gutter">
                    <div class="col-xs-4">
                        <div class="row row-no-gutter">
                            <div class="form-group">
                                <label>选人方式</label>
                                <select ng-model="assignmentType"
                                        class="form-control"
                                        ng-options="a.value as a.label for a in assignmentTypeOption"
                                        ng-change="assignmentChange(assignmentType)">
                                    <option disabled selected ng-show="!isShow" value="">请选择选人方式</option>
                                </select>
                            </div>
                        </div>
                        <div class="row row-no-gutter">
                            <!-- 根据具体角色/岗位/部门来进行选人 -->
                            <div class="form-group" ng-show="assignmentType === 1">
                                <label>组类型</label>
                                <div class="form-group">
                                    <select ng-model="groupType"
                                            class="form-control"
                                            ng-options="a.value as a.label for a in groupTypeOption"
                                            ng-change="groupTypeChange(groupType)">
                                        <option disabled selected ng-show="!isShow" value="">请选择组类型</option>
                                    </select>
                                </div>
                                <label>{{selectGroupTitle}}</label>
                                <div class="form-group">
                                    <select ng-model="groupId" ng-show="groupType !== 3"
                                            class="form-control"
                                            ng-options="a.id as a.name for a in treeData"
                                            ng-change="groupChange(groupId)">
                                        <option disabled selected ng-show="!isShow" value="">
                                            请选择{{selectGroupTitle}}
                                        </option>
                                    </select>
                                    <select ng-model="groupId" ng-show="groupType === 3"
                                            class="form-control"
                                            ng-options="a.id as a.name group by a.parentName for a in treeData"
                                            ng-change="groupChange(groupId)">
                                        <option disabled selected ng-show="!isShow" value="">
                                            请选择{{selectGroupTitle}}
                                        </option>
                                    </select>
                                </div>
                            </div>

                            <!-- 根据提交人所属公司领导进行选择人员 -->
                            <div class="form-group" ng-show="assignmentType === 3">
                                <div class="form-group">
                                    <label>公司名称</label>
                                    <select ng-model="companyId"
                                            class="form-control"
                                            ng-options="a.id as a.name group by a.parentName for a in treeData"
                                            ng-change="companyChange(companyId)">
                                        <option disabled selected ng-show="!isShow" value="">请选择所属公司名称
                                        </option>
                                    </select>
                                </div>
                                <div class="form-group">
                                    <label>职位名称</label>
                                    <select ng-model="positionId"
                                            class="form-control"
                                            ng-options="a.id as a.name for a in positionData"
                                            ng-change="positionChange(positionId)">
                                        <option disabled selected ng-show="!isShow" value="">请选择职位名称</option>
                                    </select>
                                </div>
                            </div>
                        </div>
                        <div class="row row-no-gutter">
                            <div class="form-group" ng-show="!isShow">
                                <label for="assignTypeField">{{'PROPERTY.ASSIGNMENT.ASSIGNMENT_TYPE' |
                                    translate}}</label>
                                <input type="text" id="assignTypeField" class="form-control"
                                       ng-model="popup.assignment.assignmentTypeField"/>
                            </div>
                            <div class="form-group" ng-show="!isShow">
                                <label for="typeField">{{'PROPERTY.ASSIGNMENT.GROUP_TYPE' | translate}}</label>
                                <input type="text" id="typeField" class="form-control"
                                       ng-model="popup.assignment.groupTypeField"/>
                            </div>
                            <div class="form-group" ng-show="!isShow">
                                <label for="idField">{{'PROPERTY.ASSIGNMENT.COMPANY_ID' | translate}}</label>
                                <input type="text" id="idField" class="form-control"
                                       ng-model="popup.assignment.companyIdField"/>
                            </div>
                            <div class="form-group" ng-show="!isShow">
                                <label for="assigneeField">{{'PROPERTY.ASSIGNMENT.ASSIGNEE' | translate}}</label>
                                <input type="text" id="assigneeField" class="form-control"
                                       ng-model="popup.assignment.assignee"/>
                            </div>
                            <div class="form-group">
                                <label for="userField">{{'PROPERTY.ASSIGNMENT.CANDIDATE_USERS' | translate}}</label>
                                <input type="text" id="userField" class="form-control"
                                       ng-model="popup.assignment.candidateUserField"/>
                            </div>
                            <div class="form-group" ng-show="!isShow">
                                <label for="groupField">{{'PROPERTY.ASSIGNMENT.CANDIDATE_GROUPS' | translate}}</label>
                                <input type="text" id="groupField" class="form-control"
                                       ng-model="popup.assignment.candidateGroupField"/>
                            </div>
                        </div>
                    </div>
                    <div class="col-xs-8">
                        <div class="form-group">
                            <label>{{selectTitle}}</label>
                            <div class="default-grid" ng-grid="gridOptions" ng-show="isCandidate"></div>
                            <div class="default-grid" ng-grid="gridOptions" ng-show="!isCandidate"></div>
                        </div>
                    </div>
                </div>
            </div>

            <div class="modal-footer">
                <button ng-click="close()" class="btn btn-primary" translate>ACTION.CANCEL</button>
                <button ng-click="save()" class="btn btn-primary" translate>ACTION.SAVE</button>
            </div>
        </div>
    </div>
</div>

